package org.example.completed.service.impl;

import org.example.completed.domain.Reservation;
import org.example.completed.mapper.ReservationMapper;
import org.example.completed.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReservationServiceImpl implements ReservationService {

    private final ReservationMapper reservationMapper;

    @Autowired
    public ReservationServiceImpl(ReservationMapper reservationMapper) {
        this.reservationMapper = reservationMapper;
    }

    @Override
    public List<Reservation> getAllReservations() {
        return reservationMapper.getAllReservations();  // 查询所有预约信息
    }

    @Override
    public void addReservation(Reservation reservation) {
        reservationMapper.addReservation(reservation);  // 添加预约信息
    }
}